<?php 
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' ) ;

JFilterOutput::objectHTMLSafe( $this->row );
JHTML::_( 'behavior.calendar' );

$editor =& JFactory::getEditor();

?>

<script language="javascript" type="text/javascript">

function submitbutton( pressbutton, section ) {
	var form = document.adminForm;
	if (pressbutton == 'apply' || pressbutton == 'save') {
		if ( form.subject.value == "" ) {
			alert( "<?php echo JText::_('Mail must have a subject') ?>" );
			return;
		}
	}
	
	<?php echo $editor->save( 'html_message' ) ?>
	submitform(pressbutton);
	return;
}

</script>

<form action="index.php?option=com_letterman" method="post" name="adminForm" id="adminForm" >
  
  <table cellspacing="0" cellpadding="0" border="0" width="100%" >
	  <tr>
		  <td valign="top">
			  <table class="adminform">
				<tr>
				  <td nowrap="nowrap"><label for="subject"><?php echo JText::_('Subject') ?> : </label></td>
				  <td width="100%">
				  	<input id="subject" type="text" name="subject" value="<?php echo $this->escape( $this->row->subject ) ?>" class="inputbox" style="width:90%" />
				  </td>
				</tr>
		
				<tr>
				  <td valign="top" nowrap="nowrap" ><?php echo JText::_('Message') ?> :</td>
				  <td valign="top">
				  <?php
						// parameters : areaname, content, width, height, cols, rows, show buttons
						echo $editor->display( 'html_message',  $this->row->html_message , '100%', '400', '75', '20', false ) ;
				  ?>
				  
				  </td>
				</tr>
			  </table>
		  </td>
		  
		  <td valign="top" width="330" nowrap="nowrap" style="padding-left: 5px" >
		  	<table class="adminform">
		  	 <tr><td><?php echo $this->form->render('newsletter', 'newsletter') ?></td></tr>
			</table>
		  </td>
	  </tr>
  </table>
  <input type="hidden" name="task" value="" />
  <input type="hidden" name="id" value="<?php echo $this->row->id ? $this->row->id : 0 ?>" />
  <?php echo JHTML::_( 'form.token' ) ?>
</form>

